public class demo26 {
    public static void main(String[] args) {
        int[] a = {18, 25, 7, 36, 13, 2, 89, 63};
        int maxa= a[0];
        int maxIndex = 0;

        for (int i = 1; i < a.length; i++) {
            if (a[i] > maxa) {
                maxa = a[i];
                maxIndex = i;
            }
        }
        System.out.println("最大的数是: " + maxa);
        System.out.println("最大的数的下标是: " + maxIndex);
    }
}
